{include file='common/head' /}
<body>
    　　<script src="__LAYUI__/jq.js"></script>
<div class="x-nav">
          <span class="layui-breadcrumb">
              <a><cite>店铺管理</cite></a>
              <a><cite>店铺充值列表</cite></a>
          </span>
    <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" onclick="location.reload()" title="刷新">
        <i class="layui-icon layui-icon-refresh" style="line-height:30px"></i></a>
</div>
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-body ">
                    <form class="layui-form layui-col-space5">
                        <!--店铺id-->
                        <div class="layui-inline layui-show-xs-block">
                            <input type="text" name="shop_id"  placeholder="店铺id" autocomplete="off" class="layui-input" value="{$get.shop_id|default=''}">
                        </div>
                        <!--店铺名称-->
                        <div class="layui-inline layui-show-xs-block">
                            <input type="text" name="name"  placeholder="店铺名" autocomplete="off" class="layui-input" value="{$get.name|default=''}">
                        </div>
                        <!--充值订单号-->
                        <div class="layui-inline layui-show-xs-block">
                            <input type="text" name="order_sn"  placeholder="充值订单号" autocomplete="off" class="layui-input" value="{$get.order_sn|default=''}">
                        </div>
                        <!--店铺分类-->
                        <div class="layui-inline layui-show-xs-block">
                            <select name="type_id" lay-verify="" lay-search>
                                <option value="">充值类型</option>
                                <option value="0" {if condition="$get['type'] == '0'"}selected{/if} >微信充值</option>
                                <option value="1" {if condition="$get['type'] == 1"}selected{/if} >打款</option>
                            </select>
                        </div>
                        <!--店铺状态-->
                        <div class="layui-inline layui-show-xs-block">
                            <select name="status">
                                <option value="">状态筛选</option>
                                <option value="0" {if condition="$get['status'] == '0'"}selected{/if} >待支付</option>
                                <option value="1" {if condition="$get['status'] == 1"}selected{/if} >已支付</option>
                                <option value="2" {if condition="$get['status'] == 2"}selected{/if} >支付失败</option>
                            </select>
                        </div>
                        <!-- 分页数据 -->
                        <div class="layui-inline layui-show-xs-block" style="width: 150px;">
                            <select name="limit">
                                <option value="" selected>分页数据</option>
                                <option value="10" {if condition="$get['limit'] == 10"}selected{/if}>10条</option>
                                <option value="20" {if condition="$get['limit'] == 20"}selected{/if}>20条</option>
                                <option value="30" {if condition="$get['limit'] == 30"}selected{/if}>30条</option>
                                <option value="50" {if condition="$get['limit'] == 50"}selected{/if}>50条</option>
                                <option value="100" {if condition="$get['limit'] == 100"}selected{/if}>100条</option>
                                <option value="150" {if condition="$get['limit'] == 150"}selected{/if}>150条</option>
                                <option value="200" {if condition="$get['limit'] == 200"}selected{/if}>200条</option>
                            </select>
                        </div>
                        <div class="layui-inline layui-show-xs-block">
                            <input class="layui-input"  autocomplete="off" placeholder="充值时间开始" name="start" id="start" value="{$get.start|default=''}">
                        </div>
                        <div class="layui-inline layui-show-xs-block">
                            <input class="layui-input"  autocomplete="off" placeholder="充值时间截止" name="end" id="end" value="{$get.end|default=''}">
                        </div>
                        <div class="layui-inline layui-show-xs-block">
                            <button class="layui-btn"  lay-submit="" lay-filter="sreach"><i class="layui-icon">&#xe615;</i></button>
                        </div>
                    </form>
                </div>
                <div class="layui-card-header">
                    <!--<button class="layui-btn layui-btn-normal" title="点我批量改变" onclick="pinLiangStatusBtn('is_hot')">批量热门/不热门</button>-->
                    <span style="line-height:40px;float: right;">共有数据：{$count} 条</span>
                </div>
                <div class="layui-card-body layui-table-body layui-table-main">
                    <table class="layui-table layui-form">
                        <thead>
                        <tr>
                            <th style="text-align: center;width:5%">店铺名</th>
                            <th style="text-align: center;">订单号</th>
                            <th style="text-align: center;">金额</th>
                            <th style="text-align: center;">类型</th>
                            <th style="text-align: center;">状态</th>
                            <th style="text-align: center;">添加时间</th>
                            <th style="text-align: center;">操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        {volist name="list" id="v"}
                        <tr>
                            <td style="text-align: center;">
                                <input type="checkbox" name="id" value="{$v.id}"   lay-skin="primary">
                            </td>
                            <td style="text-align: center;">{$v.name}</td>
                            <td style="text-align: center;">{$v.order_sn}</td>
                            <td style="text-align: center;">{$v.money}</td>
                            <td style="text-align: center;">
                                {if condition="empty($data['type'])"}微信充值{/if}
                                {if condition="$data['type'] == 1"}打款{/if}
                            </td>
                            <td style="text-align: center;">
                                {if condition="empty($data['status'])"}待支付{/if}
                                {if condition="$data['status'] == 1"}已支付{/if}
                                {if condition="$data['status'] == 2"}支付失败{/if}
                            </td>
                            <td style="text-align: center;"> <span style="color: #00a0e9">{:date('Y-m-d H:i:s',$v['add_time'])}</span> </td>
                            <td style="text-align: center;">
                                <br/><div style="margin-top: 10px;"></div>
                                <button class="layui-btn-danger layui-btn layui-btn-xs" title="删除" onclick="member_del(this,{$v['id']})" href="javascript:;">
                                    <i class="layui-icon">&#xe640;</i>删除
                                </button>
                            </td>
                        </tr>
                        {/volist}
                        </tbody>
                    </table>
                </div>
                <div class="layui-card-body ">
                    <div class="page">
                        {$page}
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
<script>
    layui.use(['form','laydate'], function(){
        var laydate = layui.laydate;
        var  form = layui.form;

        //执行一个laydate实例
        laydate.render({
            elem: '#start' //指定元素
        });

        //执行一个laydate实例
        laydate.render({
            elem: '#end' //指定元素
        });

        // 监听全选
        form.on('checkbox(checkall)', function(data){
            if(data.elem.checked){
                $('tbody input').prop('checked',true);
            }else{
                $('tbody input').prop('checked',false);
            }
            form.render('checkbox');
        });

        //执行一个laydate实例
        laydate.render({
            elem: '#start' //指定元素
        });
        //执行一个laydate实例
        laydate.render({
            elem: '#end' //指定元素
        });


    });

    /*删除*/
    function member_del(obj,id){
        layer.confirm('确认要删除吗？',function(index){
            $.ajax({
                url:"{:url('Shop/recharge_del')}",
                type: "post",
                data:{id:id},
                dataType:"json",
                success:function (res) {
                    if(res.code == 200){
                        layer.msg('删除成功', {icon: 1,time:1000});
                        $(obj).parents("tr").remove();
                    }else{
                        layer.alert(res.msg, {icon:2,time:1000});
                    }
                },
                error:function(e){
                    layer.alert("网络错误", {icon:5,time:1000});
                },
            });
        });
    }

</script>
{include file='common/scroll' /}
{include file='common/footer' /}